<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Vinabrand Feed</title>
<style type="text/css">
<!--
a {
	font-size: 12px;
	color: #0033CC;
}
a.title{font-size:16px; font-weight:bold;}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #996600;
}
a:hover {
	text-decoration: none;
	color: #0000CC;
}
a:active {
	text-decoration: none;
}
-->
</style></head>

<body>

<?php
if (!ini_get('display_errors')) {
    ini_set('display_errors',1);
}

require_once('functions.php');



$feed = array();
$feednews = load_rss_feed('http://vinabrand.com/news/feed/');
$feedtech = load_rss_feed('http://vinabrand.com/tech/feed/');
$feedtravel = load_rss_feed('http://vinabrand.com/travel/feed/');
$feedbrand = load_rss_feed('http://vinabrand.com/brand/feed/');
$feed = array_merge($feednews , $feedbrand ,$feedtravel,$feedtech);


$total = count($feed);
$num = 10;

$st=ceil($total/$num);
$page = $_GET['page'];
if($page == "")
{
$start = 0;
} else {
$start = ($page - 1) * $num;
}
$end = $start + $num;
if ($end > $total) {
$end = $total;
}

echo '<div style="width:600px;margin:2px auto;">';
for($i=$start;$i<$end;$i++) {
$title = str_replace(' & ', ' &amp; ', $feed[$i]['title']);
$link = $feed[$i]['link'];
$description = $feed[$i]['desc'];
$date = date('l F d, Y', strtotime($feed[$i]['date']));
echo '<div id="archive"><a class="title" target="_parent" href="'.$link.'" title="'.$title.'">'.$title.'</a><br>'.$description.'</div><br clear="all">';
}
echo '</div>';


echo '<center>';
for($i=1;$i<=$st;$i++) {
$link = '?page='.$i;
if ($page == "") {
$page = 1;
}
if ($page == $i) {
echo '<b>['.$i.']</b>';
} else {
echo '<a href="'.$link.'">'.$i.'</a>';
}
echo ' ';
}

echo '</center>';
?>
</body>
</html>